home *** CD-ROM | disk | FTP | other *** search
Wise script | 1999-04-26 | 2.8 KB | 157 lines |
- Document Type: WSE
- item: Global
- Version=5.0
- Title=Reading Text File Sample
- Flags=00000100
- Split=1420
- Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- Copy Default=1
- Japanese Font Name=MS Gothic
- Japanese Font Size=10
- Start Gradient=0 0 255
- End Gradient=0 0 0
- Windows Flags=00000000000000010000110000001000
- Message Font=MS Sans Serif
- Font Size=8
- Disk Filename=SETUP
- Patch Flags=0000000000000001
- Patch Threshold=85
- Patch Memory=4000
- end
- item: Remark
- end
- item: Remark
- Text= This sample script show different ways of reading and updating a text file.
- end
- item: Remark
- end
- item: Remark
- end
- item: Remark
- Text= First, we insert the line "File Handles=50" if it does not already exist into NET.CFG.
- end
- item: Remark
- end
- item: Set Variable
- Variable=ROOTDIR
- Value=C:
- end
- item: Insert Line into Text File
- Pathname=%ROOTDIR%\NET.TXT
- New Text=File Handles=50
- Search Text=File Handles=
- Comment Text=;
- Line Number=0
- Flags=00010110
- end
- item: Remark
- end
- item: Remark
- Text= Next, we look for the DOS=HIGH command in the CONFIG.SYS file.
- end
- item: Remark
- end
- item: Read/Update Text File
- Variable=LINE
- Pathname=%ROOTDIR%\CONFIG.SYS
- end
- item: Remark
- Text= Convert the line to all upper case.
- end
- item: Set Variable
- Variable=LINE
- Value=%LINE%
- Flags=00011000
- end
- item: Parse String
- Source=%LINE%
- Pattern=DOS=
- Variable2=DOS_PARAMS
- end
- item: If/While Statement
- Variable=DOS_PARAMS
- Value=HIGH
- Flags=00000010
- end
- item: Set Variable
- Variable=DOS_HIGH
- Value=True
- end
- item: End Block
- end
- item: End Block
- end
- item: If/While Statement
- Variable=DOS_HIGH
- Value=True
- end
- item: Display Message
- Title=Config.sys
- Text=DOS is currently loaded high.
- end
- item: End Block
- end
- item: Remark
- end
- item: Remark
- Text= Next, we comment out any IRQ= lines in NET.TXT.
- end
- item: Remark
- end
- item: Read/Update Text File
- Variable=LINE
- Pathname=%ROOTDIR%\NET.TXT
- Flags=00000001
- end
- item: Parse String
- Source=%LINE%
- Pattern=IRQ=
- Variable2=NEW_LINE
- Flags=00000010
- end
- item: If/While Statement
- Variable=NEW_LINE
- Value=%LINE%
- Flags=00000001
- end
- item: Set Variable
- Variable=LINE
- Value=; %LINE%
- end
- item: End Block
- end
- item: End Block
- end
- item: Remark
- end
- item: Remark
- Text= Last, we remove any comment lines (lines that begin with REM)
- end
- item: Remark
- end
- item: Read/Update Text File
- Variable=LINE
- Pathname=%ROOTDIR%\NET.TXT
- end
- item: Parse String
- Source=%LINE%
- Pattern=REM
- Variable2=NEW_LINE
- Flags=00000010
- end
- item: If/While Statement
- Variable=NEW_LINE
- Value=%LINE%
- end
- item: Insert Line into Text File
- Pathname=%ROOTDIR%\NET.NEW
- New Text=%LINE%
- Line Number=0
- end
- item: End Block
- end
- item: End Block
- end
- item: Remark
- end
-